package main

import (
	"fmt"
	"math"
)

func main() {
	//consts()
	//eunms()
	//eunms2()
	//enum3()

}

func enum3() {
	const (
		b = 1 << (10 * iota)
		kb
		mb
		gb
		tb
		pb
	)
	fmt.Println(b, kb, mb, gb, tb, pb)
}

func eunms2() {
	const (
		cpp  = "cpp"
		java = iota
		golang
		js
	)
	fmt.Println(cpp, java, golang, js)
}

func eunms() {
	const (
		cpp    = "cpp"
		java   = "java"
		golang = "golang"
		js     = "js"
	)
	fmt.Println(cpp, java, golang, js)
}

/**
 * 常量定义
 */
func consts() {
	const (
		filename = "abc.txt"
		a, b     = 3, 4
	)
	var c int
	c = int(math.Sqrt(a*a + b*b))
	fmt.Println(c, filename)
}
